From e25a5d08b74b28dc1b2354fcb64cf225c1eab208 Mon Sep 17 00:00:00 2001 From: zephex-alt <166333351+zephex-alt@users.noreply.github.com> Date: Mon, 6 May 2024 21:37:34 +0000 Subject: added MOVIES support. SERIES support coming soon! --- src/app/movies/[id]/page.jsx | 117 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 src/app/movies/[id]/page.jsx (limited to 'src/app/movies/[id]') diff --git a/src/app/movies/[id]/page.jsx b/src/app/movies/[id]/page.jsx new file mode 100644 index 0000000..1baec1f --- /dev/null +++ b/src/app/movies/[id]/page.jsx @@ -0,0 +1,117 @@ +import styles from "../styles/info.module.css"; +import { getInfoURL } from "../../../../utils/movie_urls"; +import Image from "next/image"; +import { PiThumbsUpFill } from "react-icons/pi"; +import { FaRegCheckCircle } from "react-icons/fa"; +import { RxDividerVertical } from "react-icons/rx"; +import { FaDollarSign } from "react-icons/fa"; +import { FaSackDollar } from "react-icons/fa6"; +import VIDEO_PLAYER from "../components/video_player"; + +export default async function MOVIE_INFO({ params }) { + const id = params.id; + const data = await get_movie_info(id); + + return ( +
+
+
+
+ Movie Poster +
+

{data.title || "Not found"}

+

+ {data.tagline || "Not found"} +

+

+ {data.overview || "Not found"} +

+
+
+
+
+ + +

{data.vote_average || "Not found"}

+
+ + + + + +

{data.vote_count || "Not found"}

+
+
+
+ + +

+ $ + {data.revenue.toLocaleString() || + "Not found"} +

+
+ + + + + +

+ $ + {data.budget.toLocaleString() || + "Not found"} +

+
+
+
+ +

Release Date: {data.release_date}

+
+
+
+ {data.genres.map((item) => ( +

{item.name || "Not found"}

+ ))} +
+
+
+ +

+ NOTE: Please wait for some time for the video to + load. If it buffers for a long time, then try + chanding the server. If the issue persists, please + check your internet connection. +

+
+
+
+
+
+
+ ); +} + +const get_movie_info = async (id) => { + const res = await fetch(getInfoURL(id), { next: { revalidate: 21620 } }); + const data = await res.json(); + return data; +}; -- cgit v1.2.3